#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-

def build(bld):

    obj = bld.new_task_gen('pypp')
    obj.source ='''
        reconfCallBacks.hpp
    '''
    obj.target = 'recEmu_wrapper'
    obj.uselib = 'SYSTEMC_H TLM BOOST BOOST_PYTHON TRAP'
    obj.uselib_local = 'systemc configEngine BFDWrapper'
    obj.include = 'scwrapper tlmwrapper trapwrapper'
    obj.includes = '../configEngine'
    obj.start_decls = 'reconfEmu'
    obj.custom_code = """
cb = mb.global_ns.classes(lambda decl: decl.name.startswith('reconfCB<'), allow_empty=True)
for i in cb:
    i.include()
    if i.name == 'reconfCB<unsigned int>':
        i.alias = 'reconfCB32'
cb = mb.global_ns.classes(lambda decl: decl.name.startswith('reconfEmulator<'), allow_empty=True)
for i in cb:
    i.include()
    if i.name == 'reconfEmulator<unsigned int>':
        i.alias = 'reconfEmulator32'
"""
    obj.templates = [
        'reconfEmu::reconfCB<unsigned int>'
        ,'reconfEmu::reconfEmulator<unsigned int>'
    ]

